/**
 * 3
 *  
 * @Author : Ruoyu Wang
 * @DateTime : 24-9-19 下午6:53
 */

#include <iostream>
#include <vector>

using namespace std;

bool check(vector<int> &nums, int k, int len, int x) {
    int t = 0;
    int i = 0;
    while (i < nums.size()) {
        if (nums[i] < x) {
            t++;
            i += len;
        } else {
            i++;
        }
    }
    if (t > k) return false;
    return true;
}

int main() {
    int n, k, len;
    cin >> n >> k >> len;
    vector<int> nums(n);
    for (int i = 0; i < n; ++i) {
        cin >> nums[i];
    }

    int l = 1;
    int r = 0x3f3f3f3f;
    int res = 0;

    while (l < r) {
        int mid = (l + r + 1) / 2;
        if (check(nums, k, len, mid)) {
            res = mid;
            l = mid;
        } else {
            r = mid - 1;
        }
    }

    cout << res << endl;

    return 0;
}